CentralCardPanel = function(config) {

    Ext.applyIf(config, {
        id : 'centralCardPanelId',
        layout : 'card',
        border : false,
        activeItem : 0,
        items : [ {
            title : 'Task list',
            border : false,
            layout : 'fit',
            items : [{
                xtype : 'taskGrid'
            }]
        }, {
            title : 'Process list',
            border : false,
            layout : 'fit',
            items : [{
                xtype : 'processGrid'
            }]
        }, new Ext.Panel({title:'Search'}), {
            title : 'Process instance list',
            border : false,
            layout : 'fit',
            items : [{
                xtype : 'processInstanceGrid'
            }]
        } ]
    });

    // Poziv konstruktora nadklase
    CentralCardPanel.superclass.constructor.apply(this, [config]);

    this.subscribe('taskTreePanelExpanded', function() {
        this.getLayout().setActiveItem(0);
    }, this);

    this.subscribe('processPanelExpanded', function() {
        this.getLayout().setActiveItem(1);
    }, this);

    this.subscribe('searchPanelExpanded', function() {
        this.getLayout().setActiveItem(2);
    }, this);

    this.subscribe('administrationPanelExpanded', function() {
        this.getLayout().setActiveItem(3);
    }, this);

};

Ext.extend(CentralCardPanel, Ext.Panel, {

});

Ext.reg('centralCardPanel', CentralCardPanel);